Skip to content

fix(fields): the fill-in dialog judges option visibleWhen on the record the write would leave - #37264

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-37250-fill-in-dialog-pending-values
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-37250-fill-in-dialog-pending-values

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37250

Clause-②: yes (widening) — the exported RequiredWhenPromptField of @object-ui/fields gains one optional member, record?: Record<string, unknown>
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在记录上就地改动(改阶段、改列表单元格、行内编辑、看板拖动)弹出「补填必填字段」时,弹窗里的下拉、单选、级联选择、关联查找和金额币种,都按这次改动后的记录来显示;比如商机改为「失败」后,丢单原因会列出该有的选项,不再显示「暂无可选项」。
  • 为什么做:补填弹窗之前根本没把记录交给里面的控件,凡是要读记录的控件都按一条空记录判断,于是有的选项被藏掉、要先选上级的列表一直停在「请先选择」,改动保存不了。
  • 出错会怎样:影响补填弹窗里各控件如何读取记录(选项显示、级联、关联查找的过滤、金额跟随的币种);若有误,最多是弹窗里某些选项多显示或少显示,可直接撤回本次改动,不涉及数据。
  • 要你做什么:无

What changes

The required-fields fill-in dialog rendered each control with no record at all, so an option visibleWhen reading record.* was judged on an empty record. An option list whose every option reads the field the change writes (hotcrm's crm_opportunity.loss_reason, shown only while stage == "closed_lost") offered nothing: the select drew its empty state and the change could not be saved.

  • collectRequiredWhenPromptFields already judges the prompt on one merge, the stored record with the change (next = { ...record, ...changes }). Each field it returns now carries that record as record (new optional member of RequiredWhenPromptField).
  • RequiredFieldsDialog hands every control dependentValues = that record with the values typed into the dialog on top, i.e. the record the write would leave. A row a host builds itself (a refusal-named field) reads the same record whenever any shown field carries one.
  • requiredWhen / field visibleWhen / readonlyWhen: already judged on next by the collector (unchanged); the new collector assertion pins that the carried record is that same merge.

Tests

ui/packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx, new top-level describe (objectstack#37250), five cases: the collector carries the merged record; a select whose options read the changed field offers them instead of the empty state; a radio offers exactly the options visible on the merged record (a won-only option stays hidden); a value typed into the dialog joins the record the other rows read; the mirror case, a select whose options are won-only, offers them on a move to closed-won.

Acceptance notes

  • Same family, outside this card's file surface, not changed here: the hosts' refusalField rows are built as { name, def } with no record. With at least one collected field shown they now read the dialog's record; with zero collected fields (the record header's stage menu opening the dialog as a pure confirmation) a refusal-added option row reads only the typed values. Hosts: ui/packages/plugin-detail/src/renderers/recordPathStageChange.tsx, ui/packages/plugin-detail/src/InlineEditSaveBar.tsx, ui/packages/plugin-grid/src/objectGridRequiredPrompt.tsx (kanban passes no refusalField).
  • ui/packages/plugin-timesheet/src/ObjectTimesheet.tsx add-row dialog renders FieldEditWidget with no dependentValues, so an option visibleWhen reading a sibling row field is judged on an empty record there too. Not a pending-change case; noted only.

Verification

Two-minute check: cd ui && pnpm --filter @object-ui/fields exec vitest run --root ../.. --maxWorkers=2 packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx — expect 12/12 passed.

Read first: ui/packages/fields/src/RequiredFieldsDialog.tsx (the liveRecord memo and the dependentValues prop), then ui/packages/fields/src/requiredWhenPrompt.ts (record: next).

Rework round 1 (head f731d2461f2)

Per the seat L1 7158746595: M1 — the widening is declared here and in the changeset; S1 — the changeset now states the condition as "the dialog handed its controls no record" and names what now resolves (option visibility, dependsOn gates, dependent-lookup filters, a money field's followed currency); N1 — a win_reason mirror pin. Dialog file 12/12; @object-ui/fields 5021 passed; type-check 0; 38/38 derived gates exit 0. Follow-up for host refusal rows: #37270.

Host refusal rows (refusal-named fields with no record) are carried by #37270.

Provenance

Opened by seat repo:objectstack#4 on the maintainer's authorization in the seat session (「#37250(推送被拦):放行」). The seat's os-dev subagent's first push was refused by its permission check; it stopped without retrying. Branch claude/issue-37250-fill-in-dialog-pending-values @ 57e988ac224.


🤖 Generated with Claude Code

https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ

…rd the write would leave

The required-fields fill-in dialog rendered each control with no record,
so an option visibleWhen reading the field the change writes (a loss
reason shown only while stage is closed_lost) was judged on an empty
record and every option was hidden. The collector already judges the
prompt on the stored record merged with the change; each returned field
now carries that record, and the dialog hands it, with the values typed
so far, to every control as dependentValues.

Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head 57e988ac2247a28ed81a799fb0fb47fa1fa67e4e · 2026-11-25T09:44Z

  • Scope: PR fix(fields): the fill-in dialog judges option visibleWhen on the record the write would leave #37264 (draft → main), Fixes #37250. 4 files, +129/−1: .changeset/37250-fill-in-dialog-pending-options.md, ui/packages/fields/src/RequiredFieldsDialog.tsx, ui/packages/fields/src/requiredWhenPrompt.ts, and the RequiredFieldsDialog.inPlace-35956 test. All files are inside the claim's file surface (claim comment 7156052572). Nothing touches content/docs/releases/.
  • Root cause, not a mask. At merge-base d7f299c0b1e, the dialog rendered <FieldEditWidget field value onChange> with no dependentValues. useCascadingOptions resolves dependentValues ?? {} and has no context fallback (retired under objectui#7206). So every option visibleWhen in the dialog was judged on {}. The collector already judges on next = { ...record, ...changes } (requiredWhenPrompt.ts, unchanged). The fix carries that same next to the controls, and the dialog adds the typed values on top. Dev claims 1–3 hold as stated.
  • Hosts: kanban (ObjectKanban.tsx), recordPathStageChange.tsx, InlineEditSaveBar.tsx and objectGridRequiredPrompt.tsx all label their fields with { ...f, def, label }. record therefore reaches the dialog on every collected row and every moreFields row with no host edit.
  • Pins re-run at head in a scratch worktree at 57e988ac224, using vitest run … RequiredFieldsDialog.inPlace-35956.test.tsx: 11/11 passed.
  • Ablation readings (same file):
  • Full @object-ui/fields suite at head: 329 files passed, 1 skipped; 5020 tests passed, 7 skipped (vitest run packages/fields, ~574 s). That matches the dev's 5020.
  • Check-runs on 57e988ac224: 57 runs, 44 success, 13 skipped, 0 failed. Named: Lint & Repo Gates success, TypeScript Type Check success, Type Check UI success, Lint UI success, Check Changeset success. GitHub reports mergeable_state: clean.
  • K = 8 against origin/main @ ede9b91f402. git merge-tree --write-tree origin/main 57e988ac224 is clean. Main has moved nothing under ui/packages/{fields,plugin-detail,plugin-grid} since the merge-base.
  • Overlap: I listed the files of all 42 other open PRs. None touches RequiredFieldsDialog*, requiredWhenPrompt*, useCascadingOptions*, recordPathStageChange*, InlineEditSaveBar* or objectGridRequiredPrompt*. No open issue mentions refusalField.
  • Changeset level: patch is right. AGENTS.md Post-Task step 3 sets the level by the Metadata-protocol kind alone. none takes patch, and a non-protocol widening ships patch. Metadata-protocol: none is right too: no metadata key, value or default moves.
  • M1 (must-fix) — Clause-②: no is a false declaration. The criterion (execution-duties.md) asks whether the card relaxes an accept set or enlarges the public surface. The public surface is what the built entry .d.ts reaches.
    • @object-ui/fields 18.6.0 is published (not private; exports["."].types = ./dist/index.d.ts). Its index.tsx re-exports type RequiredWhenPromptField, and RequiredFieldsDialogField extends it. That interface reaches RequiredFieldsDialogProps.fields and refusalField.
    • The new record?: Record<string, unknown> therefore widens both the exported shape and the props the dialog accepts.
    • Repo practice for exactly this shape is Clause-②: yes (widening). Examples in ui/packages/fields/CHANGELOG.md: "ActionParamDef gains one optional member, widget?: string" and "the exported RecordPointer type gains the optional deletedLabel".
    • Fix: write Clause-②: yes (widening) line-initial in the PR body, the changeset body and the claim comment 7156052572. The queue gate reads only the claim comment. Then route the declared widening to a TIER_DEFAULT L2 (contract-review.md) before ready or queue.
    • The dev flagged the member "For the L1" in comment 7157459458. The seat carried the claim's pre-design no forward.
  • S1 (should-fix) — Two sentences of shipping text understate the defect and the fix.
    • Changeset ¶1 says: "This happened when the field's options are each shown only for some values of the field the change writes." That is one sufficient case, not the condition. With no record handed over, any option visibleWhen reading any record field was judged on {}. That includes fields the change does not write. In addition, every dependsOn-gated option list and every dependent lookup in the dialog stayed on its "select the parent first" gate (isOptionGroupGated(dependsOn, {})). The progress comment itself says the cause "is broader than the card says".
    • 维护者速读 「出错会怎样」 says "只影响补填弹窗里下拉、单选等选项的显示". dependentValues also feeds dependent-lookup filters (LookupField), CurrencyField's followed currency and the option widgets' cascade-clear.
    • Fix: restate the condition as "the dialog handed its controls no record". Name the dependsOn gates and dependent lookups among what now resolves. Widen 「出错会怎样」 to "how the dialog's controls read the record". 「为什么做」 has the same narrowing ("没有用到这次待保存的改动"): the dialog used no record at all, so it should say that.
  • Changeset, sentence by sentence, other than M1 and S1:
    • Title: true.
    • ¶1, the hosts list (stage move, list cell, inline edit, kanban drop): true against the four hosts above.
    • "No options available": true. It is the fields.options.empty copy.
    • The loss-reason example: true.
    • ¶2 "saved record, the change, and the values typed": true (liveRecord).
    • "appears once that value is typed": pinned by case 4.
    • "not visible on that record stay hidden": pinned by case 3.
    • "fields asked for do not change": true. The collector's selection is untouched.
    • ¶3 "now carries record" and "hands it, with the typed values, to every control as dependentValues": true.
    • "reads the same record when the dialog has a field that carries one": true as far as it goes. It leaves out the zero-field case, which the PR body does state.
    • "No metadata key, value or default changes": true.
  • 维护者速读, sentence by sentence, other than S1: 「用户能看到什么变化」 is true. 「要你做什么:无」 holds: an L2 review is a seat route, not a maintainer action.
  • refusalField rows: the PR is honest about them. The PR body's acceptance notes, the changeset ¶3, the record TSDoc ("Absent on a row a host builds itself") and the progress comment all state the gap.
    • Read at head: refusalField in all three hosts returns label({ name, def: { name, ...def } }) with no record.
    • In the stage-menu confirmation (zero collected fields), judged is undefined. A refusal-added option row then reads only the typed values, without even the stage change.
    • This is no worse than main ({}), and the hosts are outside the claim's file surface, so leaving them out is right.
    • Owed: one follow-up card covering recordPathStageChange.tsx, InlineEditSaveBar.tsx and objectGridRequiredPrompt.tsx. All three share one fix shape: each refusalField sets record to the stored record with the change, through the member this PR adds. The pin is a stage-menu confirmation whose refusal names loss_reason.
    • The ObjectTimesheet.tsx add-row note (line 637, no dependentValues) is confirmed. It is a different dialog and not a pending-change case, so it is a separate card if the seat files it. It should not be folded into the refusalField card.
  • N1 — The card's triage "Done when" asks for a win_reason (→ closed_won) pin as well. The mechanism is field-agnostic, and case 3's won-only option is the inverse check. Acceptable as is.
  • N2 — The dev's report reads "each of the two ablations turns 3 red". Measured here, the collector ablation turns 4 red (it also reds the collector assertion) and the dialog ablation turns 3 red. Record the measured pair.
  • N3 — recordPathStageChange recomputes asked (fieldsNeededAt) on every host render. judged, and so liveRecord, take a new identity per render. No effect loop was found: the option widgets' cascade-clear is idempotent, and the dialog passes no onAutofill. Note only.
  • Patch round: M1 and S1 are text-only (PR body, changeset and claim comment). The changeset edit moves the head, and the PR is then owed a TIER_DEFAULT L2 on the declared widening before it can be accepted.

…the dialog's record now resolves

The changeset declares Clause-② yes (widening) for the optional `record`
member on the exported RequiredWhenPromptField, and states the defect as
the dialog handing its controls no record: option visibility, dependsOn
gates, dependent-lookup filters and a record-following currency now
resolve on the record the change would leave. Adds the win_reason mirror
pin (a move to closed_won offers the won-only reasons).

Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: f731d2461f22d8480492ec2095bdfa17d6399eaa
Local-runs: probe — one declaration build of @object-ui/fields (vite build, vite-plugin-dts) at merge-base d7f299c and at head, to diff the published .d.ts
Scope: declaration face, no hits floor (record-recognisers: the paths decide no face; the changeset's Clause-② line gives --face declaration). Whole diff read: .changeset/37250-fill-in-dialog-pending-options.md, ui/packages/fields/src/requiredWhenPrompt.ts, ui/packages/fields/src/RequiredFieldsDialog.tsx, ui/packages/fields/src/tests/RequiredFieldsDialog.inPlace-35956.test.tsx

① Derived judgments

  • What is declared: Clause-②: yes (widening), Metadata-protocol: none. readClause2Line and readMetadataProtocolLine read exactly this on the PR body, the changeset at this head and claim comment 7156052572.
  • Is the member optional and additive? Yes.
    • The emitted declarations differ between merge-base and head in one file only, requiredWhenPrompt.d.ts. The diff is +record? (a Record of string to unknown) with its TSDoc, on interface RequiredWhenPromptField.
    • index.d.ts:1180 re-exports type RequiredWhenPromptField. RequiredFieldsDialog.d.ts:4 has RequiredFieldsDialogField extends RequiredWhenPromptField. That puts the member in RequiredFieldsDialogProps.fields, in the return type of moreFields and in the return type of refusalField.
    • Every one of those positions is host-supplied input to the dialog, or collector output the host passes through. In both cases an optional member only widens what is accepted.
    • No existing object literal or host type stops compiling. Type Check UI and TypeScript Type Check are success on this head.
  • Is anything in the published .d.ts narrowed? No.
    • RequiredFieldsDialog.d.ts is byte-identical between merge-base and head.
    • No function signature changed. collectRequiredWhenPromptFields still returns RequiredWhenPromptField[].
    • No member became required, and no union lost an arm.
  • Runtime: collectRequiredWhenPromptFields now sets record on every element it returns. This adds a key to each returned object. It is not a type change.

② Semver level

  • '@object-ui/fields': patch is right.
    • The level follows the Metadata-protocol: kind alone: none takes patch.
    • A non-protocol widening of a TypeScript export ships patch. Repo precedent in ui/packages/fields/CHANGELOG.md: ActionParamDef gaining widget?, and RecordPointer gaining deletedLabel.
    • No metadata key, value or default moves, so Metadata-protocol: none holds.
  • Check Changeset is success on this head.
  • The changeset's prose has one inaccurate sentence: "Options that are not visible on that record stay hidden". It is false for unguarded conditions, which failed open before. This is the L1's S2. It does not touch the level or the declaration.

③ Boundary flags

Implemented-by: claude/issue-37250-fill-in-dialog-pending-values
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head f731d2461f22d8480492ec2095bdfa17d6399eaa · 2026-11-25T10:40Z

  • Delta: one commit f731d2461f2 on 57e988ac224. It changes two files, +40/−9: .changeset/37250-fill-in-dialog-pending-options.md and RequiredFieldsDialog.inPlace-35956.test.tsx. Neither src file moved. The whole PR is still 4 files, all inside the claim's file surface.
  • Prior M1 is closed. I ran readClause2Line and readMetadataProtocolLine (scripts/pm/clause2-line.mjs) on all three carriers. Each reads { value: yes, arm: widening } and Metadata-protocol: none:
    • the live PR body;
    • the changeset at head;
    • claim comment 7156052572, edited 2026-11-25T10:16Z. Its line now reads Clause-②: yes (widening) (corrected at L1 7158746595 …).
    • none with the widening arm needs no Skills-docs: line (os-dev.md).
  • The fail-open versus guarded claim is confirmed against the evaluator.
    • The path: useCascadingOptions → dependentValues ?? {} → resolveVisibleOptions → evalFieldPredicate(…, fallback = true). A not-ok engine verdict returns the fallback.
    • I probed it at head through resolveVisibleOptions and evalFieldPredicate. The two numbers after each record are the options offered on that record.
    • Unguarded record.stage == "closed_lost": {} → 1, stage: negotiation → 0, stage: closed_lost → 1. On {} the fault is [runtime] No such key: stage, so the option fails open.
    • Guarded has(record.stage) && record.stage == "closed_lost": {} → 0, negotiation → 0, closed_lost → 1. There is no fault, so the option is hidden.
    • The test file's LOST_ONLY disjunction gives 0 / 0 / 1.
    • The dev's correction stands. The prior L1 overstated this when it said every option visibleWhen "was judged on {}" as if hidden. Only a has()-guarded condition hides on {}; an unguarded one is offered whatever it says. See S2 for what follows from this.
  • Prior S1 (shipping text) is closed in the changeset. Sentence by sentence against the code:
    • Title ("hands its controls the record the change would leave"): true. dependentValues={liveRecord}, where liveRecord = { ...judged, ...values }.
    • ¶1 "handed its controls no record, so every control that reads the record judged it on an empty one": true. useCascadingOptions and LookupField both resolve dependentValuesProp ?? {}, and neither has a context fallback (objectui#7206).
    • ¶1 the guarded and unguarded sentences: true, per the probe above.
    • ¶1 "No options available" / could not be saved / the loss-reason example: true, as in the prior L1.
    • ¶1 "Every option list gated by dependsOn, and every dependent lookup, stayed on its 'select the parent first' gate": true. Both isOptionGroupGated and LookupField.dependenciesMissing are true on {} for any non-empty dependsOn.
    • ¶2 the four bullets:
      • option visibility: true;
      • dependsOn gates on option lists and lookups: true;
      • dependent-lookup filters: true (lookupFilters $record values);
      • followed currency: true (CurrencyField → useFollowedParentRecord(currencyField, dependentValues, …)).
      • FilterConditionField, RecipientPickerField, RegistryRefField, SummaryField and FormulaField also read dependentValues. They are metadata-admin or read-only widgets, and the list does not claim to be exhaustive.
    • ¶3 "appears once that value is typed": pinned by case 5. "Which fields the dialog asks for … does not change": true, because the collector is untouched apart from record: next.
    • ¶3 "Options that are not visible on that record stay hidden": see S2.
    • ¶4 Widening: true, measured. A vite build of @object-ui/fields at the merge-base and at head gives a declaration diff that is exactly requiredWhenPrompt.d.ts +record? (a Record of string to unknown). index.d.ts:1180 re-exports the type, and RequiredFieldsDialog.d.ts:4 extends it. "sets it on every field it returns": there is one push site, requiredWhenPrompt.ts:165, record: next. The refusal-row sentences match shown.find((f) => f.record)?.record.
    • "No metadata key, value or default changes": true.
  • Prior S1 is closed in the PR body's 维护者速读, sentence by sentence:
    • 「用户能看到什么变化」: true. It now names cascades, lookups and currency.
    • 「为什么做」「根本没把记录交给里面的控件…有的选项被藏掉、要先选上级的列表一直停在「请先选择」」: true. "有的" is accurate given fail-open.
    • 「出错会怎样」: the scope clause is widened as asked. See N2 for the consequence clause.
    • 「要你做什么:无」: holds.
    • No code names, paths or bare card numbers appear in the 速读.
  • Prior N1 (the win_reason mirror pin) is done. The case the mirror case: a move to closed_won offers the win reasons its options gate on uses the guarded WON_ONLY and asserts that loss_reason is absent.
  • Pins, re-run at head in a scratch worktree (since removed) with vitest run packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx: 12/12 passed.
  • Dialog ablation (drop dependentValues={liveRecord}): 4 failed / 8 passed. The four are the select case, the radio case, the mirror case and the typed-value case. The tree was restored clean afterwards. This matches the expected 4.
  • Check-runs on f731d2461f2, after polling until complete: 61 runs, 46 success, 15 skipped, 0 failed. Named: Lint & Repo Gates success, TypeScript Type Check success, Type Check UI success, Lint UI success, Test UI success, Build & E2E UI success, Check Changeset success. GitHub reports mergeable_state: clean (draft).
  • K = 12 against origin/main @ 057cedfa9b6, merge-base d7f299c0b1e. git merge-tree --write-tree origin/main f731d2461f2 is clean. On main since the merge-base, the only change in the family's packages is plugin-detail/src/RelatedList.tsx and its test. Nothing has moved under ui/packages/fields, core/src/evaluator, the four hosts, or .changeset/37250*.
  • Contract review: the paths decide no face, and the changeset's Clause-②: yes (widening) gives --face declaration, so TIER_DEFAULT. The record is posted separately and gives VERDICT PASS on this head.
  • Follow-up Fill-in dialog: a host's refusal-named row carries no record, so its options read only the typed values #37270 (the hosts' refusalField rows) is filed and open. It covers the one card the prior L1 asked for.
  • S1 (should-fix) — The PR body's English half is stale against the new head.
    • ## Verification still says "expect 11/11 passed". The file now runs 12. That is the maintainer's two-minute check, and its expected reading is wrong. The same body's ## Rework round 1 says 12/12.
    • ## Tests still says "four cases" and lists four. The file now has five: the mirror case is missing.
    • Fix: change it to 12/12, and add the mirror case to ## Tests. This is a body-only edit and does not move the head.
  • S2 (should-fix) — Changeset ¶3 says "Options that are not visible on that record stay hidden." That contradicts the changeset's own ¶1 for unguarded conditions.
    • ¶1 says an unguarded condition "could not be evaluated, and the option was offered whatever the condition said". The probe confirms that: unguarded record.stage == "closed_lost" was offered on {}.
    • At head the record carries stage. The same option is now hidden on stage: negotiation, so it does not "stay" hidden.
    • For an app that writes its option predicates without has(), this PR takes options out of the dialog that it offered before. That is the one user-visible narrowing in the change, and the changelog sentence tells consumers it does not happen.
    • It is not a contract narrowing: the declared visibleWhen is honoured, and the code is correct. It is shipping text that understates the change.
    • Fix: restate it as "Options that are not visible on that record are hidden, including those whose condition could not be evaluated before and so were offered."
    • The 速读's 「都按这次改动后的记录来显示」 already covers both directions, so no 速读 edit is needed for this.
  • N1 — The RequiredFieldsDialog.tsx comment above liveRecord (source, unchanged this round) says "with no record handed over every option reading the field the change writes was judged hidden". That is true only for has()-guarded conditions. Correct it if the head moves anyway for S2. Not owed on its own.
  • N2 — 速读 「出错会怎样」 lists lookups and currency in its scope clause. Its consequence clause still reads 「最多是弹窗里某些选项多显示或少显示…不涉及数据」.
    • A wrong record would also mis-filter lookup candidates. It would also set an amount's currency width, and CurrencyField rounds typed input on blur at that width.
    • Suggested wording: 「若有误,弹窗里的选项、关联记录候选或金额小数位可能不对;保存前可见,可直接撤回本次改动」.
  • N3 — The changeset's ¶1 phrase "A condition guarded by has(record.x) was false" fits the has(…) && … idiom only. A !has(record.x) condition was true on {}. Note only.
  • Patch round:
    • S1 is a body edit, and the head does not move.
    • S2 edits the changeset, so the head moves. The TIER_DEFAULT record on f731d2461f2 then names a stale head. A changeset-only delta needs a fresh record on the new head, and its re-check is the Clause-② reading plus the check-runs.
    • Make the S2 edit, and the N1 comment fix if wanted, in one commit.

…ord used to let through

Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: c69148c9887de4715670615a4ddba681703fda8a
Local-runs: none
Scope: declaration face, no hits floor. The paths decide no face, and the changeset's Clause-② line gives --face declaration.

  • Delta read: f731d2461f2→c69148c9887. It is one file, .changeset/37250-fill-in-dialog-pending-options.md, +1/−1, ¶3 only.
  • No src or test file moved, so the declaration probe from the f731d2461f2 record carries over unchanged. That probe was a vite build of @object-ui/fields at merge-base d7f299c0b1e and at head.

① Derived judgments

  • What is declared is unchanged: Clause-②: yes (widening) and Metadata-protocol: none. Both lines are outside the changed hunk of the changeset, and the PR body carries the same two lines.
  • Is the member optional and additive? Yes. The finding carries over:
    • The emitted declarations differ from merge-base only in requiredWhenPrompt.d.ts. The difference is +record? (a Record of string to unknown) on RequiredWhenPromptField.
    • It reaches RequiredFieldsDialogField through extends. Every position it reaches is input the host supplies, or collector output the host passes through.
  • Is anything in the published .d.ts narrowed? No. No source changed in this delta. Type Check UI and TypeScript Type Check are success on this head.
  • Runtime is unchanged from the prior record. collectRequiredWhenPromptFields sets record on every element it returns.

② Semver level

  • '@object-ui/fields': patch is right. Metadata-protocol: none takes patch, and a non-protocol widening of a TypeScript export ships patch, per repo precedent in ui/packages/fields/CHANGELOG.md.
  • Check Changeset is success on this head.
  • The prose inaccuracy the prior record noted is fixed. ¶3 no longer says options "stay hidden".
    • ¶3 now states that each option follows its condition on the record the write would leave.
    • It states that an unguarded condition such as record.stage == "closed_lost", which was offered on the empty record, is now hidden when it is false. So the dialog can offer fewer options than before in apps that do not guard with has().
    • It states that a condition still unevaluable on that record (one naming a field the record does not carry) is still offered.
    • This matches evalFieldPredicate (a not-ok verdict returns fallback) and resolveVisibleOptions (fallback = true). It is consistent with ¶1.
    • The level and the declaration are untouched.

③ Boundary flags

Implemented-by: claude/issue-37250-fill-in-dialog-pending-values
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head c69148c9887de4715670615a4ddba681703fda8a · 2026-11-25T11:05Z

  • Delta: one commit, c69148c9887, on f731d2461f2. git diff --stat f731d2461f2 c69148c9887 shows 1 file, +1/−1: .changeset/37250-fill-in-dialog-pending-options.md ¶3. No src or test file moved. The whole PR is still the same 4 files, all inside the claim's file surface. The prior readings carry over unchanged:
    • pins 12/12;
    • dialog ablation 4 failed / 8 passed;
    • the {} / negotiation / closed_lost probe;
    • the declaration diff.
  • Prior S1 (PR body) is closed. The live body's ## Verification now says "expect 12/12 passed". ## Tests now says "five cases" and lists the mirror case (won-only options offered on a move to closed-won).
  • Prior S2 (changeset ¶3) is closed. I read the new ¶3 sentence by sentence against evalFieldPredicate (ui/packages/core/src/evaluator/fieldRules.ts:236) and resolveVisibleOptions (optionRules.ts:97, which calls with fallback = true):
    • "Each option is now shown or hidden by its condition on the record the write would leave." This is true. dependentValues={liveRecord}, where liveRecord = { ...judged, ...values } and judged is the collector's next. See N1 for the dependsOn gate.
    • "If the condition is true on that record, the option is shown. If it is false, the option is hidden." This is true. An ok verdict returns res.value === true. See N2 for non-boolean results.
    • "This includes an option the dialog used to offer only because its condition could not be evaluated on an empty record." This is true. On {} an unguarded read faults ([runtime] No such key: …), and a not-ok verdict returns fallback.
    • "an unguarded record.stage == "closed_lost" used to be offered whatever the stage. It is now hidden when the stage stays "negotiation"." This is true, per the prior probe: {} gives 1 option offered, stage: negotiation gives 0.
    • "in an app whose option conditions do not guard with has(), the dialog can offer fewer options than before." This is true, and it is the narrowing the prior S2 asked the changeset to state.
    • "A condition that still cannot be evaluated on that record is still offered, for example one that names a field the record does not carry." This is true.
      • A key absent from the merged record faults the same way {} did. Any not-ok verdict, and the blank, unevaluable and throw paths, all return fallback, which is true here.
      • A field present with value null does not fault. It is evaluated, so "does not carry" is the right word.
    • "An option that depends on another value typed into the dialog appears once that value is typed." This is true and is pinned by the typed-value case.
    • "Which fields the dialog asks for was already decided on this record and does not change." This is true. Apart from record: next, the collector is untouched.
  • I re-read the rest of the changeset sentence by sentence. Everything outside ¶3 is byte-identical to f731d2461f2, so the prior L1's readings stand:
    • title and ¶1: no record handed over; guarded conditions false; unguarded conditions faulted and offered; "No options available"; the loss-reason example; dependsOn gates stuck;
    • ¶2 and its four bullets;
    • ¶4 Widening;
    • the closing no-metadata line.
    • ¶3 no longer contradicts ¶1: both now state fail-open for an unevaluable condition.
    • Clause-②: yes (widening) and Metadata-protocol: none are on unchanged lines.
  • Check-runs on c69148c9887 were polled until complete at 2026-11-25T11:04Z: 57 runs, 44 success, 13 skipped, 0 failed.
    • Named gates: Lint & Repo Gates success, TypeScript Type Check success, Type Check UI success, Lint UI success, Test UI success, Build & E2E UI success, Check Changeset success.
    • GitHub reports mergeable_state: clean (draft).
  • K = 12 against origin/main @ 057cedfa9b6 (the GitHub tip, unchanged since the prior L1). Merge-base is d7f299c0b1e. git merge-tree --write-tree origin/main c69148c9887 is clean.
    • Since the merge-base, main has changed nothing under ui/packages/fields, core/src/evaluator, the hosts or .changeset/37250*. Its only change in the family is plugin-detail/src/RelatedList.tsx and its test, as before.
  • Contract review: changeset-only delta, same face (--face declaration), TIER_DEFAULT. A fresh record on this head is posted separately, with VERDICT PASS.
  • N1 — "Each option is now shown or hidden by its condition" holds once the list is past its dependsOn gate. While a dependsOn field is empty, resolveCascadingOptions offers none, whatever the conditions say. ¶2's second bullet already names the gates, so this is a reading note only.
  • N2 — An ok verdict that is not boolean true (for example record.flag with flag: null, or a non-boolean expression) hides the option. The binary true/false wording does not cover it, but it does not contradict it either. Note only.
  • N3 — The prior N1 is still open: the RequiredFieldsDialog.tsx comment above liveRecord says every option "was judged hidden" with no record, which is true only for has()-guarded conditions. The head moved for S2 without taking it. Source comment only, and not owed.
  • N4 — The prior N2 is still open: the 速读 「出错会怎样」 consequence clause. The body also has no ## Rework round 2 entry for c69148c9887. Body-only, and not owed.
  • Landing: the seat lands it after measuring K; if K ≥ 15 it merges main first; a merge-only head move keeps this ACCEPT.

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Landing · 2026-11-25T11:06Z · PR #37264 at c69148c9887de4715670615a4ddba681703fda8a (card #37250, p1).

  • Records at this head:
    • L1 ACCEPT 7160580928.
    • Contract review PASS (TIER_DEFAULT, declaration face) 7160567909.
  • Prior rounds: both L1 rounds before this one were REWORK, and both are closed:
    • 7158746595 (M1, S1);
    • 7160031230 (S1, S2).
  • Tier: not governed (ui/packages/fields and one changeset). 4 files, under 3,000 lines, so Tier S: the seat lands it.
  • K and merge-tree: K = 12; git merge-tree against origin/main is clean.
  • Check-runs: 57 runs, 44 success, 13 skipped, 0 failed.
  • Follow-up: Fill-in dialog: a host's refusal-named row carries no record, so its options read only the typed values #37270 carries the hosts' refusal rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants